﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public struct AssetStruct
{
    public string assetBundleName;
    public string assetNames;
}

public class Packing
{

    [MenuItem("Packing/Make AssetsBundle")]
    static void PackAsset()
    {
        List<AssetBundleBuild> builds = new List<AssetBundleBuild>();
        AssetBundleBuild build0 = new AssetBundleBuild();
        build0.assetBundleName = "resources1.assetbundle";
        build0.assetNames = new string[]
        {
            "Assets/Resources/3ds/quanxi/jiaobeineicetidigunqiu.FBX",
            "Assets/Resources/3ds/quanxi/danjiaocaiqiuhoutui.FBX",
            "Assets/Resources/3ds/quanxi/danjiaocaituiqiuqianjin.FBX",
            "Assets/Resources/3ds/quanxi/jiaoneiceraoquanyunqiu.FBX",
            "Assets/Resources/3ds/quanxi/danjiaoneiwaiceyunqiu.FBX",
            "Assets/Resources/3ds/quanxi/hengxianglaqiu.FBX",
            "Assets/Resources/3ds/quanxi/caiqiu.FBX",
            "Assets/Resources/3ds/quanxi/Vzilaqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeiwaiceyunqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeizhengmianyunqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeineiceyunqiu.FBX",
            "Assets/Resources/3ds/quanxi/dianqiu.FBX",
            "Assets/Resources/3ds/quanxi/datuidianqiu.FBX",
            "Assets/Resources/3ds/quanxi/xiongbujieqiu.FBX",
            "Assets/Resources/3ds/quanxi/datuijieqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaoneicejiedigunqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeiwaicejiedigunqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaoneicejiekongzhongqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeijiekongzhongqiu.FBX",
            "Assets/Resources/3ds/quanxi/zhijiewaiqiu.FBX",
            "Assets/Resources/3ds/quanxi/yuanditoudingqiu.FBX",
            "Assets/Resources/3ds/quanxi/tiaoqizhengmiantouqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaozhangjieqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeizhengmiantiqiu.FBX",
            "Assets/Resources/3ds/quanxi/jiaobeiwaicetiqiu.FBX",
        };
        builds.Add(build0);

        //AssetBundleBuild build1 = new AssetBundleBuild();
        //build1.assetBundleName = "animation_icon.assetbundle";
        //build1.assetNames = new string[] {
        //    "Assets/Resources/images/1.jpg",
        //    "Assets/Resources/images/2.jpg" };
        //builds.Add(build1);


        string targetPath = Application.dataPath + "/StreamingAssets";
        BuildPipeline.BuildAssetBundles(targetPath, builds.ToArray(),
                BuildAssetBundleOptions.UncompressedAssetBundle, BuildTarget.Android);
        AssetDatabase.Refresh();
    }

    [MenuItem("Packing/Pack2")]
    static void Pack2()
    {
        Debug.Log("Pack2");
    }
}
